package com.app.designpatternslearn.structured.compositepattern.code

class Node {

    var name: String? = null

    private val subNodes = mutableListOf<Node>()

    fun add(node: Node) = subNodes.add(node)

    fun remove(node: Node) = subNodes.remove(node)

    override fun toString(): String {
        return "Node(name=$name, subNodes=$subNodes)"
    }


}